# variables

# GRPC-TOOLS required. Install with `nuget install Grpc.Tools`.
# Then un-comment and replace [DIRECTORY] with location of files.
# For example, on macOS, you might have something like:
COMPILER=Grpc.Tools.1.14.1/tools/macosx_x64
# COMPILER=[DIRECTORY]

#path to ts plugin
GEN_TS_PATH=./node_modules/.bin/protoc-gen-ts
# Path to the grpc_node_plugin
PROTOC_GEN_GRPC_PATH="./node_modules/.bin/grpc_tools_node_protoc_plugin"

SRC_DIR=proto/mlagents_envs/communicator_objects
SRC_DIR_ONNX=proto/onnx
DST_DIR_C=../project/extensions/mlagents/static/assets/Runtime/Grpc/CommunicatorObjects
DST_DIR_T=../project/extensions/mlagents/static/assets/ONNX/Generated
DST_DIR_P=../ml-agents-envs
PROTO_PATH=proto
PYTHON_PACKAGE=mlagents_envs/communicator_objects

# clean
rm -rf $DST_DIR_C
mkdir -p $DST_DIR_C

# generate proto objects in TS
npx protoc --ts_out $DST_DIR_C --proto_path proto $SRC_DIR/*.proto
npx protoc --ts_out $DST_DIR_T --proto_path proto $SRC_DIR_ONNX/*.proto